package com.hzncc.flowable_diboot.project_contracts.vo;

import com.diboot.core.binding.annotation.BindDict;
import com.diboot.core.binding.annotation.BindEntityList;
import com.diboot.core.binding.annotation.BindField;
import com.diboot.core.vo.FileVO;
import com.diboot.core.vo.LabelValue;
import com.diboot.file.entity.FileRecord;
import com.diboot.iam.entity.IamUser;
import com.hzncc.flowable_diboot.entity.SapCustomer;
import com.hzncc.flowable_diboot.project_contracts.entity.ProjectContractAudit;
import com.hzncc.flowable_diboot.project_contracts.entity.ProjectContractCancel;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;

/**
* 项目类合同取消 VO定义
* @author MyName
* @version 1.0
* @date 2024-09-24
* Copyright © MyCorp
*/
@Getter @Setter @Accessors(chain = true)
public class ProjectContractCancelListVO extends ProjectContractCancel  {
private static final long serialVersionUID = 1218764722656445266L;
    /**
    * 采购订单编号 关联信息
    */

    @BindField(
        entity = ProjectContractAudit.class,
        field = "contractCode",
        condition = "this.contractId = id"
     )
    private String contractCode;

    /**
    * 客户名称 关联信息
    */

    @BindField(
        entity = SapCustomer.class,
        field = "name",
        condition = "this.customerId = id"
     )
    private String customerName;

    /**
    * 合同类型 关联字典选项
    */
    @BindDict(
    type = "projectContractType",
    field = "contractType"
    )
    private LabelValue contractTypeLabel;

    /**
    * 发货情况 关联字典选项
    */
    @BindDict(
    type = "deliverySituation",
    field = "shippingStatus"
    )
    private LabelValue shippingStatusLabel;

    /**
    * 开票情况 关联字典选项
    */
    @BindDict(
    type = "invoiceSituation",
    field = "invoicingStatus"
    )
    private LabelValue invoicingStatusLabel;

    /**
    * 申请人 关联信息
    */

    @BindField(
        entity = IamUser.class,
        field = "realname",
        condition = "this.applicant = id"
     )
    private String applicantLabel;

    /**
    * 项目类合同id 关联信息
    */

    @BindField(
        entity = ProjectContractAudit.class,
        field = "contractCode",
        condition = "this.contract_id = id"
     )
    private String contractIdLabel;

    /**
    * 客户id 关联信息
    */

    @BindField(
        entity = SapCustomer.class,
        field = "sapNo",
        condition = "this.customer_id = id"
     )
    private String customerIdLabel;

    /**
    * 负责人 关联信息
    */

    @BindField(
        entity = IamUser.class,
        field = "realname",
        condition = "this.responsible_person = id"
     )
    private String responsiblePersonLabel;

    /**
    * 销售员 关联信息
    */

    @BindField(
        entity = IamUser.class,
        field = "realname",
        condition = "this.salesperson = id"
     )
    private String salespersonLabel;

    /**
    * 创建人 关联信息
    */

    @BindField(
        entity = IamUser.class,
        field = "realname",
        condition = "this.create_by = id"
     )
    private String createByLabel;

    /**
    * 更新人 关联信息
    */

    @BindField(
        entity = IamUser.class,
        field = "realname",
        condition = "this.update_by = id"
     )
    private String updateByLabel;

    @BindEntityList(
            entity = FileRecord.class,
            condition = "this.auditAttachment = id",
            splitBy = ","
    )
    private List<FileVO> auditAttachmentFiles;

    /**
     * 产品类型 关联字典选项
     */
    @BindDict(
            type = "contractProductType",
            field = "productType"
    )
    private LabelValue productTypeLabel;

    /**
     * 退票情况 关联字典选项
     */
    @BindDict(
            type = "ticketRefund",
            field = "returnTicketStatus"
    )
    private LabelValue returnTicketStatusLabel;

    @BindDict(
            type = "returnedWarehouse",
            field = "returnStockStatus"
    )
    private LabelValue returnStockStatusLabel;

}